package com.joven.shelltest.utils.funcinterface;

import com.joven.shelltest.dto.DealMessageDto;
import com.joven.shelltest.dto.ResultDto;

/**
 * @author wzj
 * @since 2024/11/1 15:06
 */
public class DataProcessor {
    public static <T, R> R processData(T data, DataTransformer<T, R> transformer) {
        return transformer.transform(data);
    }

    public static ResultDto convertToStudent(DealMessageDto msg) {
        ResultDto student = new ResultDto();
        student.setStatusCode(Integer.valueOf(msg.getStatus()));
        student.setMessage(msg.getMessage());
        student.setData(msg.getDealMethod());
        return student;
    }
}
